package com.elvende.web.client.view;

import java.util.ArrayList;

import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.FocusWidget;
import com.google.gwt.user.client.ui.Widget;

public class View extends Composite{
	
	protected ArrayList<FocusWidget> myComponentList = new ArrayList<FocusWidget>();
	
	public void setViewOnly(){
		for (FocusWidget c : myComponentList){
			c.setEnabled(false);
		}
	}
	
	public void setUpdatable(){
		for (FocusWidget c : myComponentList){
			c.setEnabled(true);
		}
	}
	
	public View controlWidget(FocusWidget w){
		myComponentList.add(w);
		return this;
	}
	
	public Widget asWidget() {
		   return this;
	}	
}
